import React from "react";
import { SubTitle } from "../SubTitle";
import Style from "./index.module.less";
import DraggableModal from "./DraggableModal";

/**
 * 公共弹窗组件
 */
export const CommonModal = props => {
	const { title, children, centered = true, className, ...args } = props;
	return (
		<DraggableModal
			className={Style.modal + " " + className}
			title={<SubTitle as="s4" className={Style.title} {...title} />}
			centered
			okButtonProps={{
				size: "middle"
			}}
			cancelButtonProps={{
				size: "middle"
			}}
			{...args}
		>
			<div className={Style.modal_content_wrap}>{children}</div>
		</DraggableModal>
	);
};
export default CommonModal;
